package net.openl10n.api.document;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import net.openl10n.api.Namespaces;

@XmlType(name="textFlowType", namespace=Namespaces.DOCUMENT)
public class TextFlow extends Resource{

	private String lang;
	private String content;

	public TextFlow() {
	}
	
	public TextFlow(String id) {
		super(id);
	}
	
	public TextFlow(String id, String lang) {
		this(id);
		this.lang = lang;
	}
	
	@XmlAttribute(name="lang", namespace=Namespaces.XML, required=true)
	public String getLang() {
		return lang;
	}
	
	public void setLang(String lang) {
		this.lang = lang;
	}

	@XmlElement(name="content",namespace=Namespaces.DOCUMENT, required=true)
	public String getContent() {
		if(content == null)
			return "";
		return content;
	}
	
	public void setContent(String content) {
		this.content = content;
	}
}
